


#ifndef _BSP_BLE_H_
#define _BSP_BLE_H_

#include <stdint.h>
#include <stdbool.h>

#define BLE_USART_PORT		 UART3
#define BLE_RST_PORT       GPIOC
#define BLE_RST_PIN        GPIO_PIN_12
#define BLE_RST_CLR()      gpio_bit_reset(BLE_RST_PORT, BLE_RST_PIN) 
#define BLE_RST_SET()      gpio_bit_set(BLE_RST_PORT, BLE_RST_PIN) 
#define BLE_CON_PORT			 GPIOB
#define BLE_CON_PIN				 GPIO_PIN_2
#define BLE_CON_GET()			 ((GPIO_ISTAT(BLE_CON_PORT) & BLE_CON_PIN) ? 1:0)

void BSP_BLE_Init(void);
void BSP_BLE_Reset(void);
bool BSP_BLE_is_connect(void);
void BSP_BLE_SendBuf(uint8_t buf[], uint32_t len);
void BSP_BLE_SendByte(uint8_t ch);
int BSP_BLE_ReceiveByte(uint32_t timeout);
int BSP_BLE_ReceiveByteAsync(void);

void BSP_BLE_ClearBuffer(void);
int BSP_BLE_ConnectState(void);

void BSP_BLE_Callback(uint8_t rx);
#endif



